<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            font: 30px / 90px "微软雅黑";
        }
        ul{
            list-style: none;
        }
        .wrap{
            width: 1000px;
            height: 1000px;
            position: absolute;
            left: 50%;
            top: 50%;
            margin-top: -500px;
            margin-left: -500px;
            background: url(img/bg.jpg) no-repeat;
        }
        .menu{
            width: 330px;
            border-radius: 10px;
            overflow: hidden;
            margin-top: 285px;
            margin-left: 335px;
            background: #f87a75;
            box-shadow: 0 20px 50px rgba(248,122,117,.5);
        }
        .title{
            height: 90px;
            padding-left: 112px;
            box-sizing: border-box;
            color: #fff;
            position: relative;
        }
        .title::after{
            content: '';
            position: absolute;
            right: 36px;
            top: 41px;
            background: url(img/ar.png) no-repeat ;
            width: 28px;
            height: 16px;
        }
        .list{
            width: 316px;
            padding-left:7px; 
            padding-bottom: 5px;
            display: none;
        }
        .list li{
            height: 90px;
            margin-bottom: 2px;
            background:#fee4e3;
            border-radius: 20px;
            padding-left: 112px;
            box-sizing: border-box;
            background-position: 23px 24px;
            background-repeat: no-repeat;

        }
        .list li:hover{
            background-color: #fff;
            box-shadow:0 0 50px rgba(248,122,117,0.93);
            position: relative;
        }
        .list li:nth-of-type(1){
            background-image: url(img/icon1.png);
        }
        .list li:nth-of-type(2){
            background-image: url(img/icon2.png);
        }
        .list li:nth-of-type(3){
            background-image: url(img/icon3.png);
        }
        .list li:nth-of-type(4){
            background-image: url(img/icon4.png);
        }
        .list li:nth-of-type(5){
            background-image: url(img/icon5.png);
        }
    </style>
    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>
    <script src="../js/babel.min.js"></script>
</head>
<body>
<div class="wrap">
    
</div>
<script type="text/babel">
    let actn = false;
    let mun = "菜单";
    function fn(){
        console.log("111");
        if(actn){
            actn = false;
            // listELe.style.display = "none";
        }else{
            actn = true;
            // listELe.style.display = "block";
        };
        console.log(actn);
        lem = <div className="menu">
            <div className="title" onClick={()=>{fn()}}>{mun}</div>
            <ul className="list" style={{display:actn?"block":"none"}}>
                <li onClick={()=>{fn(),fns(1)}}>微博</li>
                <li onClick={()=>{fn(),fns(2)}}>图片</li>
                <li onClick={()=>{fn(),fns(3)}}>博客</li>
                <li onClick={()=>{fn(),fns(4)}}>视频</li>
                <li onClick={()=>{fn(),fns(5)}}>更多>></li>
            </ul>
        </div>
    tes.render(lem);
    }
    function fns(n){
        // if(actn){
        //     actn = false;
        //     // listELe.style.display = "none";
        // }else{
        //     actn = true;
        //     // listELe.style.display = "block";
        // };
        if(n==1){
            mun = "微博";
        }else if(n==2){
            mun = "图片";
        }else if(n==3){
            mun = "博客";
        }else if(n==4){
            mun = "视频";
        }else if(n==5){
            mun = "更多>>";
        }
        console.log(actn);
        lem = <div className="menu">
            <div className="title" onClick={()=>{fn()}}>{mun}</div>
            <ul className="list" style={{display:actn?"block":"none"}}>
                <li onClick={()=>{fn(),fns(1)}}>微博</li>
                <li onClick={()=>{fn(),fns(2)}}>图片</li>
                <li onClick={()=>{fn(),fns(3)}}>博客</li>
                <li onClick={()=>{fn(),fns(4)}}>视频</li>
                <li onClick={()=>{fn(),fns(5)}}>更多>></li>
            </ul>
        </div>
        tes.render(lem);
    }
    let lem = <div className="menu">
            <div className="title" onClick={()=>{fn()}}>{mun}</div>
            <ul className="list"  style={{display:actn?"block":"none"}}>
                <li onClick={()=>{fn1()}}>微博</li>
                <li onClick={()=>{fn2()}}>图片</li>
                <li onClick={()=>{fn3()}}>博客</li>
                <li onClick={()=>{fn4()}}>视频</li>
                <li onClick={()=>{fn5()}}>更多>></li>
            </ul>
        </div>
    let tes = ReactDOM.createRoot(document.querySelector(".wrap"));
    tes.render(lem);
</script>
<!-- <li>微博</li>
<li>图片</li>
<li>博客</li>
<li>视频</li>
<li>更多</li> -->
</body>
</html>